<!Doctype html>
<html xmlns="http://www.w3.org/1999/html">
<!---------------------------------------------------------
Auther:：Fin;  Version：Autotestplat-V2.7
----------------------------------------------------------->
<head>
    <meta charset="UTF-8">
    <title> 产品管理 </title>
    <link href="/static/dist/css/style.css" rel="stylesheet" type="text/css">
    <link href="/static/css/dt.css" rel="stylesheet" type="text/css">
    <link href="/static/css/navbar.css" rel="stylesheet" type="text/css">
    <script src="/static/vendors/jquery/dist/jquery.min.js" type="text/javascript"></script>
    <script src="/static/vendors/popper.js/dist/umd/popper.min.js"></script>
    <script src="/static/src/localfiles/bootstrap.min.js"></script>
    <script src="/static/src/localfiles/jquery.dataTables.min.js"></script>
    <script src="/static/src/localfiles/dataTables.bootstrap4.min.js"></script>
    <script src="/static/vendors/laydate/laydate.js" type="text/javascript"></script>
    <script src="/static/js/public.js"></script>
    <script src="/static/js/product.js"></script>
    <script>
        window.onload = function(){
            if(loginVerify() == 200){
                infoInit()
            }
        }
    </script>

</head>
<body>
    <div class="row" >
        <div class="col-sm">
            <ul class="nav nav-pills nav-pills-success nav-pills-square nav-light bg-white pa-15 fixed-top">
                <li class="nav-item">
                    <a href={% url 'product' %} class="nav-link active"> 产品管理 </a>
                </li>
                <li class="nav-item">
                    <a href={% url 'apitestcase' %} class="nav-link"> 接口用例 </a>
                </li>
                <li class="nav-item">
                    <a href={% url 'apitestplan' %} class="nav-link"> 测试计划 </a>
                </li>
                <li class="nav-item">
                    <a href={% url 'apireport' %} class="nav-link"> 测试报告 </a>
                </li>
                <li class="nav-item">
                    <a href={% url 'apiperformance' %} class="nav-link"> 性能测试 </a>
                </li>
                <li class="nav-item dropdown" id="uiDropdown">
                <a id="uitest" class="nav-link"> UI测试 </a>
                <ul class="dropdown-menu" id="uiDropdownMenu">
                    <li><a href={% url 'apptestcase' %} class="nav-link"> AppUI测试 </a></li>
                    <li><a href={% url 'webtestcase' %} class="nav-link"> WebUI测试 </a></li>
                </ul>
                </li>
                <li class="nav-item">
                    <a href={% url 'parasettings' %} class="nav-link"> 系统设置 </a>
                </li>
                <li class="nav-item">
                    <a href={% url 'user' %} class="nav-link "> 用户管理 </a>
                </li>
                <li class="nav-item" id="cur_product" style="margin-left: 200px">
                    <select id="select-option" name="setInput"  onchange="saveOption()">
                        <option>{{ product_name }}</option>
                        {% for product in product_alls %}
                        <option>
                        {% if product.product_name == product_name %}
                            {{ product.product_name }} ✓
                        {% else %}
                            {{ product.product_name }}
                       {% endif %}
                       </option>
                       {% endfor %}
                    </select>
                </li>
                <li class="nav-item dropdown-user" id="navUser">
                    <a href="#" class="nav-link" id="userName" style="font-size: 13px"></a>
                <ul class="dropdown-menu" id="userDropdownMenu">
                    <li> <a href="https://docs.qq.com/doc/DSVNlZ0xoUWpHYlpx?u=2f0ea49eb4e247f5b3c604c3d58ef026" class="nav-link" style="font-size: 13px" target="_black">使用手册</a></li>
                    <li><a class="nav-link" onclick="logout()" style="font-size: 12px"> 退出 </a></li>
                </ul>
                </li>
            </ul>
        </div>
    </div>

    <div id="outterDiv" class="hk-wrapper screenHeight">
        <div class="container" style="padding: 70px 20px; max-width: 1800px;">
        <section class="hk-sec-wrapper">
            <div class="row" style="padding: 0px 0px; margin: -15px 0;margin-left: 0px" id="searchFields">
                <div class="input-group"  style="width: 30%; margin-right: 20px;" >
                    <span style="font-size: 12px;height: 35px" class="input-group-text">产品名称: </span>
                    <input name="searchField" style="font-size: 12px;height: 35px" class="form-control" placeholder="--请输入--" >
                </div>
                <div class="input-group"  style="width: 30%; margin-right: 20px;">
                    <span style="font-size: 12px;height: 35px" class="input-group-text">产品介绍: </span>
                    <input name="searchField" style="font-size: 12px;height: 35px" class="form-control" placeholder="--请输入--" >
                </div>
                <button class="btn btn-primary btn-sm" style="margin-left: 5%;width: 57px;height: 34px;font-size: 14px" onclick="searchClick()">查询</button>
                <button class="btn btn-primary btn-sm" style="margin-left: 20px;width: 57px;height: 34px;font-size: 14px" onclick="showAddModal(this)">添加</button>
            </div>

            <br>
            <table id="table" class="table table-hover" data-sort="false">
                <hr>
                <thead>
                    <tr>
                        <th style="width: 30px;text-align: left; line-height: 0px; padding-top: 0px;font-size:14px;font-weight: bold; ">ID</th>
                        <th style="width: 150px;text-align: left; line-height: 0px; padding-top: 0px;font-size:14px;font-weight: bold; ">产品名称</th>
                        <th style="width: 100px;text-align: left; line-height: 0px; padding-top: 0px;font-size:14px;font-weight: bold; ">产品类型</th>
                        <th style="width: 150px;text-align: left; line-height: 0px; padding-top: 0px;font-size:14px;font-weight: bold; ">产品介绍</th>
                        <th style="width: 50px;text-align: left; line-height: 0px; padding-top: 0px;font-size:14px;font-weight: bold; ">创建人</th>
                        <th style="width: 100px;text-align: left; line-height: 0px; padding-top: 0px;font-size:14px;font-weight: bold; ">操作</th>
                    </tr>
                </thead>
            </table>
        </section>
        </div>
    </div>

    <div class="modal fade" id="addModal" tabindex="-1" role="dialog" style="display: none;" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">添加产品</h5>
                    <button class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="input-group" style="margin-bottom: 15px;">
                        <span class="input-group-text" style="width: 130px; padding-left: 25px;"><span style="color: red;">* </span>产品名称</span>
                        <input name="addInput1" class="form-control" placeholder="--请输入--">
                    </div>
                    <div class="input-group" style="margin-bottom: 15px;">
                        <span class="input-group-text" style="width: 130px; padding-left: 25px;"><span style="color: red;">* </span>产品类型</span>
                        <input name="addInput1" class="form-control" placeholder="--请输入--">
                    </div>
                    <div class="input-group" style="margin-bottom: 15px;">
                        <span class="input-group-text" style="width: 130px; padding-left: 25px;"><span style="color: red;">* </span>产品介绍</span>
                        <input name="addInput1" class="form-control" placeholder="--请输入--">
                    </div>
                </div>
                <button class="btn btn-success " style="width: 15%; margin-bottom: 10px; margin-left: 50%;transform: translate(-50%,0);" onclick="add()">确 定</button>
            </div>
        </div>
    </div>

    <div class="modal fade" id="modifyModal" tabindex="-1" role="dialog" style="display: none;" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">修改产品</h5>
                    <button class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="input-group" style="margin-bottom: 15px;">
                        <span class="input-group-text" style="width: 130px; padding-left: 25px;"><span style="color: red;">* </span>产品编码</span>
                        <input name="modInput" disabled="disabled" class="form-control" placeholder="--请输入--">
                    </div>
                    <div class="input-group" style="margin-bottom: 15px;">
                        <span class="input-group-text" style="width: 130px; padding-left: 25px;"><span style="color: red;">* </span>产品名称</span>
                        <input name="modInput" class="form-control" placeholder="--请输入--">
                    </div>
                    <div class="input-group" style="margin-bottom: 15px;">
                        <span class="input-group-text" style="width: 130px; padding-left: 25px;"><span style="color: red;">* </span>产品类型</span>
                        <input name="modInput" class="form-control" placeholder="--请输入--">
                    </div>
                    <div class="input-group" style="margin-bottom: 15px;">
                        <span class="input-group-text" style="width: 130px; padding-left: 25px;"><span style="color: red;">* </span>产品介绍</span>
                        <input name="modInput" class="form-control" placeholder="--请输入--">
                    </div>
                </div>
                <button class="btn btn-success" style="width: 15%; margin-bottom: 10px; margin-left: 50%;transform: translate(-50%,0);" onclick="mod()">保 存</button>
            </div>
        </div>
    </div>

    <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" style="display: none;" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">删除确认</h5>
                    <button class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="input-group" style="margin-bottom: 15px;">
                        <span class="input-group-text" style="width: 130px; padding-left: 25px;">产品编码</span>
                        <input name="delInput" disabled="disabled" class="form-control">
                    </div>
                    <div class="input-group" style="margin-bottom: 15px;">
                        <span class="input-group-text" style="width: 130px; padding-left: 25px;">产品名称</span>
                        <input name="delInput" disabled="disabled" class="form-control">
                    </div>
                </div>

                <button class="btn btn-danger" style="width: 15%; margin-bottom: 10px; margin-left: 50%;transform: translate(-50%,0);" onclick="del(this)">确 定</button>
            </div>
        </div>
    </div>

</body>
</html>

